#pragma once

#include <stdint.h>
#include <string>

#include "util/executor.h"


class IOContext;
class HttpServer;
class AbcServerDispatcher;

namespace html::tmplt
{
class Factory;
} // namespace html::tmplt

class AbcServer
{
public:
    AbcServer();

    ~AbcServer();

    void exec();

    Executor &executor();

    AbcServerDispatcher &dispatcher() {
        return *dispatcher_;
    }

    html::tmplt::Factory &httpTemplateFactory() {
        return *htmlTemplateFactory_;
    }

    const std::string &title() const {
        return title_;
    }

private:
    const std::string title_;
    IOContext *ioContext_;
    AbcServerDispatcher *dispatcher_;
    HttpServer *httpServerOnTCP_;
    HttpServer *httpServerOnSSL_;
    html::tmplt::Factory *htmlTemplateFactory_;
};
